/*
 * @Date: 2025-04-02 21:38:15
 * @LastEditors: 贾二小 erxiao.jia@outlook.com
 * @LastEditTime: 2025-04-13 17:15:17
 * @FilePath: /admin/vue/src/stores/useUserStore.ts
 */
import { defineStore } from 'pinia'

export default defineStore('user-store', {
  state: () => {
    return {
      userInfo: null as UserModel | null,
      token: useStorage().get(CacheEnum.TOKEN_NAME) || '',
      loginLoading: false,
    }
  },
  getters: {
    /** 是否登录 */
    isLogin(state) {
      return Boolean(state.token)
    },
  },
  actions: {},
})
